home *** CD-ROM | disk | FTP | other *** search
- property currentDemo, currentURL, launchButton, killList
-
- on new me, parameterList
- set killList to []
- set launchButton to getaProp(parameterList, #launchButton)
- if launchButton > 0 then
- set the visible of sprite launchButton to 0
- end if
- set currentDemo to 0
- set currentURL to 0
- return me
- end
-
- on init me, newDemo, newURL
- put "Init Demo" && newDemo && newURL
- if not stringp(newDemo) and not stringp(newURL) then
- put "Demo Button initialized with no demo or URL!"
- clear(me)
- else
- if launchButton > 0 then
- set the visible of sprite launchButton to 1
- end if
- set currentDemo to newDemo
- set currentURL to newURL
- end if
- end
-
- on TurnOn me
- if stringp(currentDemo) and (currentDemo <> "-") then
- set curplatform to the platform
- if isMac() then
- set path to currentDemo
- set path to replace(path, "\", ":")
- else
- delpush("\")
- set basepath to the moviePath
- set path to item 1 of basepath & "\" & currentDemo
- delpop()
- end if
- put path
- open(path)
- else
- if stringp(currentURL) and (currentURL <> "-") then
- if isMac() then
- set currentURL to replace(currentURL, "\", ":")
- else
- set currentURL to replace(currentURL, ":", "\")
- end if
- put "Launching browser to URL:" && currentURL
- launchBrowserUsingRefreshFile(the moviePath & currentURL)
- end if
- end if
- end
-
- on TurnOff me
- end
-
- on clear me
- if launchButton > 0 then
- set the visible of sprite launchButton to 0
- end if
- set currentDemo to 0
- set currentURL to 0
- end
-
- on dispose me
- set currentDemo to 0
- set currentURL to 0
- set launchButton to 0
- ClearObjectList(killList)
- set killList to []
- end
-